<template>
  <div id="container1" />
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
const TMap = (window as any).TMap
const map = ref(null)

const initTxMap = () => {
  //定义地图中心点坐标
  const center = new TMap.LatLng(39.98412, 116.307484)
  //定义map变量，调用 TMap.Map() 构造函数创建地图
  map.value = new TMap.Map(document.getElementById('container1'), {
    center: center, //设置地图中心点坐标
    zoom: 11, //设置地图缩放级别
    viewMode: '3D'
  })
}

onMounted(() => {
  initTxMap()
})
</script>

<style>
#container1 {
  width: 100%;
  height: 100%;
}
</style>
